<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>添加地区</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  
    {include file="public/css"}
    {include file="public/js"}
</head>
<body>

<div class=""  style="padding:20px">
<form class="layui-form" >
<input type="hidden" name="pid" value="{$pid}">

              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;"> 上级地区</label>
                <div class="layui-input-inline">
                    <div class="layui-form-mid">{$name} </div>

                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;"> 地区名称</label>
                <div class="layui-input-inline">
                  <input type="text" name="name" lay-verify="name" autocomplete="off" placeholder="" class="layui-input" >
                </div>
               <div class="layui-form-mid layui-word-aux">{:about('地区名称')}</div>
              </div>


              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;"></label>
                <div class="layui-input-inline">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="form">确 定</button>
                </div>
              </div>

</form>
</div>

<script>
layui.use(['element', 'layer','form'], function(){
   var  element = layui.element, layer = layui.layer,form = layui.form;
 //监听提交
  form.on('submit(form)', function(data){
    $.post("{:url('area/add')}",$("form").serialize(),function(json){
          if(json.code == 0){
            layer.msg(json.msg);
            $("input[type='text']").val('');
          }else{
            layer.msg(json.msg);
          }
    });
      return false;
  });

});


</script>

</body>

</html>